nanopyx.liquid._le_interpolation_bicubic

Shift and Magnify using the NanoPyx Liquid Engine

ShiftAndMagnify(clear_benchmarks=False, testing=False)

Initialize the Liquid Engine The Liquid Engine base class is inherited by children classes that implement specific methods

Engine responsabilities:

  1. Store implemented run types;
  2. Handle previous benchmarks and I/O;
  3. When queried, benchmark all available run types;
  4. Run a specific method using a selected run type;

Benchmark files have the following format: The benchmark file is read as dict of dicts. BENCHMARK DICT FOR A SPECIFIC METHOD |- RUN_TYPE #1 | |- ARGS_REPR #1 | | |- [score, t2run#1, t2run#2, t2run#3, ...] last are newer. nan means fail | |- ARGS_REPR #2
| | |- [score, t2run#1, t2run#2, t2run#3, ...] last are newer. nan means fail | (...) |- RUN_TYPE #2 (...)

def benchmark( self, image, shift_row, shift_col, magnification_row, magnification_col):

Benchmark the ShiftAndMagnify run function in multiple run types

Parameters
  • image: The image to shift and magnify
  • shift_row: The number of rows to shift the image
  • shift_col: The number of columns to shift the image
  • magnification_row: The magnification factor for the rows
  • magnification_col: The magnification factor for the columns
Returns

The benchmark results

def run( self, image, shift_row, shift_col, magnification_row, magnification_col, run_type=None) -> numpy.ndarray:

Shift and magnify an image using Bicubic interpolation

Parameters
  • image: The image to shift and magnify
  • shift_row: The number of rows to shift the image
  • shift_col: The number of columns to shift the image
  • magnification_row: The magnification factor for the rows
  • magnification_col: The magnification factor for the columns
Returns

The shifted and magnified image

Shift, Scale and Rotate (affine transform) using the NanoPyx Liquid Engine

ShiftScaleRotate(clear_benchmarks=False, testing=False)

Initialize the Liquid Engine The Liquid Engine base class is inherited by children classes that implement specific methods

Engine responsabilities:

  1. Store implemented run types;
  2. Handle previous benchmarks and I/O;
  3. When queried, benchmark all available run types;
  4. Run a specific method using a selected run type;

Benchmark files have the following format: The benchmark file is read as dict of dicts. BENCHMARK DICT FOR A SPECIFIC METHOD |- RUN_TYPE #1 | |- ARGS_REPR #1 | | |- [score, t2run#1, t2run#2, t2run#3, ...] last are newer. nan means fail | |- ARGS_REPR #2
| | |- [score, t2run#1, t2run#2, t2run#3, ...] last are newer. nan means fail | (...) |- RUN_TYPE #2 (...)

def benchmark(self, image, shift_row, shift_col, scale_row, scale_col, angle):

Benchmark the ShiftMagnifyScale run function in multiple run types

Parameters
  • image: The image to shift, scale and rotate
  • shift_row: The number of rows to shift the image
  • shift_col: The number of columns to shift the image
  • scale_row: The scale factor for the rows
  • scale_col: The scale factor for the columns
  • angle: Angle of rotation in radians. Positive is counter clockwise
Returns

The benchmark results

def run( self, image, shift_row, shift_col, scale_row, scale_col, angle, run_type=None) -> numpy.ndarray:

Shift and scale an image using Bicubic interpolation

Parameters
  • image: The image to shift and magnify
  • shift_row: The number of rows to shift the image
  • shift_col: The number of columns to shift the image
  • scale_row: The scale factor for the rows
  • scale_col: The scale factor for the columns
  • angle: Angle of rotation in radians. Positive is counter clockwise
Returns

The shifted, magnified and rotated image